package java44th.group.controller;

import java44th.group.bean.po.MarketAdmin;
import java44th.group.bean.admin.vo.BaseRespVo;
import java44th.group.bean.po.MarketCart;
import java44th.group.mapper.MarketAdminMapper;
import java44th.group.service.wx.cart.WxCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Aurhor: 帅的一批
 * @CreateAt: 2022/10/11 10:38
 * @Description:
 * @PACKAGE_NAME： java44th.group.controller
 */
@RestController
@RequestMapping("test")
public class TestController {
    @Autowired
    WxCartService cartService;
    @PostMapping("insert")
    public BaseRespVo insert(@RequestBody List<MarketCart> insertmsg){
        cartService.insert(insertmsg);
        return BaseRespVo.ok();
    }
    @RequestMapping("hao")
    public BaseRespVo testHao() {
        return BaseRespVo.ok("ok");
    }
    @RequestMapping("databaseTest")
    public BaseRespVo databaseTest(MarketAdminMapper marketAdminMapper){
        MarketAdmin marketAdmin = marketAdminMapper.selectByPrimaryKey(1);
        return BaseRespVo.ok(marketAdmin);
    }

}
